Skip to content

fix: prompt generation as part of RCV audit flow#2309

Open
dipratap wants to merge 4 commits intomainfrom
pgen
Open

fix: prompt generation as part of RCV audit flow#2309
dipratap wants to merge 4 commits intomainfrom
pgen

Conversation

@dipratap
Copy link
Copy Markdown
Contributor

@dipratap dipratap commented Apr 6, 2026

Summary

Wires RCV prompt generation into the prerender audit pipeline. The default audit behaviour
is completely unchanged — prompts are generated only when generatePrompts=true is explicitly
passed (opt-in). Also plumbs LLMO site config (categories/topics/regions) through to Mystique
so generated prompts can be correctly classified.

What changed

src/prerender/handler.js — sending the Mystique request

  • sendPrerenderGuidanceRequestToMystique accepts a new generatePrompts parameter
    (defaults to false) and includes it in the SQS payload
  • Each suggestion now carries hasPrompts: true when it already has stored prompts, so
    Mystique can skip re-generation
  • Reads LLMO site config (categories, topics, region codes) from
    site.getConfig().getLlmoConfig() and sends them as llmoCategories, llmoTopics,
    llmoRegions
  • handleAiOnlyMode parses generatePrompts from the SQS data field using the same
    safe JSON parsing pattern already used for opportunityId and scrapeJobId

src/prerender/guidance-handler.js — receiving Mystique's response

  • Destructures prompts from each incoming suggestion alongside url, aiSummary, valuable
  • Persists prompts with a preserve-or-update strategy:
    prompts: hasNewPrompts ? prompts : (currentData.prompts ?? [])
    New prompts win; existing prompts are kept when Mystique returns an empty array
  • Adds suggestionsWithPrompts and totalPromptCount to the quality-metrics log line

@Danialkafeel Danialkafeel marked this pull request as ready for review April 7, 2026 10:46
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

This PR will trigger a patch release when merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants